[id].vue 763 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <LayoutContainer>
  3. <div>
  4. <h2>{{ $t('cycle') }}</h2>
  5. <UiFormEdition
  6. :model="Cycle"
  7. :go-back-route="goBackRoute"
  8. >
  9. <template v-slot="{ entity }">
  10. <UiInputText
  11. field="label"
  12. v-model="entity.label"
  13. :rules="rules()"
  14. />
  15. </template>
  16. </UiFormEdition>
  17. </div>
  18. </LayoutContainer>
  19. </template>
  20. <script setup lang="ts">
  21. import { useI18n } from 'vue-i18n'
  22. import Cycle from "~/models/Education/Cycle";
  23. const i18n = useI18n()
  24. const goBackRoute = { path: `/parameters`, query: { tab: 'teaching' } }
  25. const rules = () => [
  26. (label: string | null) => (label !== null && label.length > 0) || i18n.t('please_enter_a_value'),
  27. ]
  28. </script>